package collection;

import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;

public class StreamAPIDemo5 {
    public static void main(String[] args) {
        List<Integer>list=new ArrayList<>();
        for (int i=0;i<10;i++){
            list.add(i);
        }
        System.out.println(list);
        List<Double> list2 = list.stream().mapToDouble(e -> e / 2)
                .boxed()//转换是需要包装的,
                .collect(Collectors.toList());
        System.out.println(list2);
    }
}
